import { Component, OnInit, Input } from '@angular/core';
import { Router } from "@angular/router";
import { Location } from '@angular/common'

@Component({
  selector: 'app-exhibition-station-overview',
  templateUrl: './station-overview.component.html',
  styleUrls: ['./station-overview.component.css']
})
export class StationOverviewComponent implements OnInit {
  public stu:number = 2;
  constructor(
    private location:Location,
    private router: Router
  ){}
  public totalKks:string = 'HDZ00W00';
  public waterLevel:any = {
    highlevel:1140,
    limitlevel:1138,
    deathlevel:1076,
    nowlevel:1128
  };
  public units1: Array<any>=[
    {
      index: '1',
      status:  '3',
      performance:'2'
    },
    {
      index: '2',
      status:  '2',
      performance:'1'
    },
    {
      index: '3',
      status:  '1',
      performance:'2'
    }
  ];
  public units2: Array<any>=[
    {
      index: '1',
      status:  '0',
      performance:'3'
    },
    {
      index: '2',
      status:  '2',
      performance:'2'
    },
    {
      index: '3',
      status:  '1',
      performance:'1'
    }
  ];
  ngOnInit() {
  }

  perform(num:number){
    this.stu = num;
  }

  public goBack(flag?:boolean){
    if(flag){
      this.location.back()
    }
    else {
      this.router.navigate(['/pages/home'])
    }
  }
}
